package com.zhuhao.utils;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @Author zhuhao
 * @Date 2021/11/23 15:54
 * @desc
 */
public class StringUtils {

    /**
     * JavaScript escape/unescape 编码的 Java 实现
     * author jackyz
     * keep this copyright info while using this method by free
     */
    private final static String[] hex = {
            "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0A", "0B", "0C", "0D", "0E", "0F",
            "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1A", "1B", "1C", "1D", "1E", "1F",
            "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2A", "2B", "2C", "2D", "2E", "2F",
            "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3A", "3B", "3C", "3D", "3E", "3F",
            "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4A", "4B", "4C", "4D", "4E", "4F",
            "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5A", "5B", "5C", "5D", "5E", "5F",
            "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6A", "6B", "6C", "6D", "6E", "6F",
            "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7A", "7B", "7C", "7D", "7E", "7F",
            "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8A", "8B", "8C", "8D", "8E", "8F",
            "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9A", "9B", "9C", "9D", "9E", "9F",
            "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "AA", "AB", "AC", "AD", "AE", "AF",
            "B0", "B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8", "B9", "BA", "BB", "BC", "BD", "BE", "BF",
            "C0", "C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9", "CA", "CB", "CC", "CD", "CE", "CF",
            "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", "D8", "D9", "DA", "DB", "DC", "DD", "DE", "DF",
            "E0", "E1", "E2", "E3", "E4", "E5", "E6", "E7", "E8", "E9", "EA", "EB", "EC", "ED", "EE", "EF",
            "F0", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "FA", "FB", "FC", "FD", "FE", "FF"
    };
    private final static byte[] val = {
            0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
            0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
            0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
            0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
            0x3F, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
            0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
            0x3F, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
            0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
            0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
            0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
            0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
            0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
            0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
            0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
            0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
            0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F
    };

    public static String escape(String s) {
        StringBuffer sbuf = new StringBuffer();
        int len = s.length();
        for (int i = 0; i < len; i++) {
            int ch = s.charAt(i);
            if (ch == ' ') {                        // space : map to '+'
                sbuf.append('+');
            } else if ('A' <= ch && ch <= 'Z') {    // 'A'..'Z' : as it was
                sbuf.append((char) ch);
            } else if ('a' <= ch && ch <= 'z') {    // 'a'..'z' : as it was
                sbuf.append((char) ch);
            } else if ('0' <= ch && ch <= '9') {    // '0'..'9' : as it was
                sbuf.append((char) ch);
            } else if (ch == '-' || ch == '_'       // unreserved : as it was
                    || ch == '.' || ch == '!'
                    || ch == '~' || ch == '*'
                    || ch == '/' || ch == '('
                    || ch == ')') {
                sbuf.append((char) ch);
            } else if (ch <= 0x007F) {              // other ASCII : map to %XX
                sbuf.append('%');
                sbuf.append(hex[ch]);
            } else {                                // unicode : map to %uXXXX
                sbuf.append('%');
                sbuf.append('u');
                sbuf.append(hex[(ch >>> 8)]);
                sbuf.append(hex[(0x00FF & ch)]);
            }
        }
        return sbuf.toString();
    }

    public static String unescape(String s) {
        StringBuffer sbuf = new StringBuffer();
        int i = 0;
        int len = s.length();
        while (i < len) {
            int ch = s.charAt(i);
            if (ch == '+') {                        // + : map to ' '
                sbuf.append(' ');
            } else if ('A' <= ch && ch <= 'Z') {    // 'A'..'Z' : as it was
                sbuf.append((char) ch);
            } else if ('a' <= ch && ch <= 'z') {    // 'a'..'z' : as it was
                sbuf.append((char) ch);
            } else if ('0' <= ch && ch <= '9') {    // '0'..'9' : as it was
                sbuf.append((char) ch);
            } else if (ch == '-' || ch == '_'       // unreserved : as it was
                    || ch == '.' || ch == '!'
                    || ch == '~' || ch == '*'
                    || ch == '/' || ch == '('
                    || ch == ')') {
                sbuf.append((char) ch);
            } else if (ch == '%') {
                int cint = 0;
                if ('u' != s.charAt(i + 1)) {         // %XX : map to ascii(XX)
                    cint = (cint << 4) | val[s.charAt(i + 1)];
                    cint = (cint << 4) | val[s.charAt(i + 2)];
                    i += 2;
                } else {                            // %uXXXX : map to unicode(XXXX)
                    cint = (cint << 4) | val[s.charAt(i + 2)];
                    cint = (cint << 4) | val[s.charAt(i + 3)];
                    cint = (cint << 4) | val[s.charAt(i + 4)];
                    cint = (cint << 4) | val[s.charAt(i + 5)];
                    i += 5;
                }
                sbuf.append((char) cint);
            }
            i++;
        }
        return sbuf.toString();
    }


    public static String delHTMLTag(String htmlStr) {
        String script = "<script[^>]*?>[\\s\\S]*?<\\/script>";
        String style = "<style[^>]*?>[\\s\\S]*?<\\/style>";
        String blockquote = "<blockquote[^>]*?>[\\s\\S]*?<\\/blockquote>";
        String html = "<[^>]+>";
        String white = "&nbsp;";
        String quot = "&quot;";
        String amp = "&amp;";
        String lt = "&lt;";
        String gt = "&gt;";
        Pattern pScript = Pattern.compile(script, 2);
        Matcher mScript = pScript.matcher(htmlStr);
        htmlStr = mScript.replaceAll("");

        Pattern pStyle = Pattern.compile(style, 2);
        Matcher mStyle = pStyle.matcher(htmlStr);
        htmlStr = mStyle.replaceAll("");

        Pattern pblockquote = Pattern.compile(blockquote, 2);
        Matcher mblockquote = pblockquote.matcher(htmlStr);
        htmlStr = mblockquote.replaceAll("");

        Pattern pHtml = Pattern.compile(html, 2);
        Matcher mHtml = pHtml.matcher(htmlStr);
        htmlStr = mHtml.replaceAll("");

        htmlStr = htmlStr.replaceAll(white, " ");
        htmlStr = htmlStr.replaceAll(amp, "&");
        htmlStr = htmlStr.replaceAll(lt, "<");
        htmlStr = htmlStr.replaceAll(gt, ">");
        htmlStr = htmlStr.replaceAll(quot, "\"");

        String[] split = htmlStr.split("\n");
        //去除多余的换行
        StringBuilder str = new StringBuilder();
        for (String s : split) {
            if (org.apache.commons.lang3.StringUtils.isNotBlank(s)) {
                str.append(s).append("\n");
            }
        }

        return str.toString().trim();
    }

    /**
     * 去除部分标签的内容
     */
    public static String removeHtmlTag(String inputString) {
        if (inputString == null) {
            return null;
        }
        String htmlStr = inputString; // 含html标签的字符串
        String textStr = "";
        java.util.regex.Pattern p_script;
        java.util.regex.Matcher m_script;
        java.util.regex.Pattern p_style;
        java.util.regex.Matcher m_style;
        java.util.regex.Pattern p_html;
        java.util.regex.Matcher m_html;

        java.util.regex.Pattern p_html1;
        java.util.regex.Matcher m_html1;
        try {
            //定义script的正则表达式{或<script[^>]*?>[\\s\\S]*?<\\/script>
            String regEx_script = "<[\\s]*?script[^>]*?>[\\s\\S]*?<[\\s]*?\\/[\\s]*?script[\\s]*?>";
            //定义style的正则表达式{或<style[^>]*?>[\\s\\S]*?<\\/style>
            String regEx_style = "<[\\s]*?style[^>]*?>[\\s\\S]*?<[\\s]*?\\/[\\s]*?style[\\s]*?>";
            // 定义HTML标签的正则表达式
            String regEx_html = "<(?![img|/img|video|/video])[^>]+>";


            String regEx_html1 = "<\\/(?![img|/img|video|/video])[a-zA-Z]{1,10}+>";

            htmlStr = htmlStr.replaceAll("<!--(.|[\r\n])*?-->","");

            htmlStr = htmlStr.replaceAll("</p>", "\r\n");

            htmlStr = htmlStr.replace("<br\\s*/?>", "");

            p_script = Pattern.compile(regEx_script, Pattern.CASE_INSENSITIVE);
            m_script = p_script.matcher(htmlStr);
            htmlStr = m_script.replaceAll(""); // 过滤script标签
            p_style = Pattern.compile(regEx_style, Pattern.CASE_INSENSITIVE);
            m_style = p_style.matcher(htmlStr);
            htmlStr = m_style.replaceAll(""); // 过滤style标签
            p_html = Pattern.compile(regEx_html, Pattern.CASE_INSENSITIVE);
            m_html = p_html.matcher(htmlStr);
            htmlStr = m_html.replaceAll(""); // 过滤html标签


            p_html1 = Pattern.compile(regEx_html1, Pattern.CASE_INSENSITIVE);
            m_html1 = p_html1.matcher(htmlStr);
            htmlStr = m_html1.replaceAll(""); // 过滤html标签

            htmlStr = htmlStr.replace("\r\n\r\n", "\r\n");
            textStr = htmlStr;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return textStr;// 返回文本字符串
    }

    public static void main(String[] args) throws UnsupportedEncodingException {

        String s = "%3Cp%3E%C4%87%3C/p%3E%0A%0A%3Cp%3E%E7%BD%91%E9%A1%B5%E5%B8%83%E5%B1%80%EF%BC%88layout%EF%BC%89%E6%98%AF%20CSS%20%E7%9A%84%E4%B8%80%E4%B8%AA%E9%87%8D%E7%82%B9%E5%BA%94%E7%94%A8%E3%80%82%3C/p%3E%0A%0A%3Cp%3E%3Cimg%20alt=%22%22%20src=%22https://www.ruanyifeng.com/blogimg/asset/2015/bg2015071001.gif%22%20title=%22%22%20/%3E%3C/p%3E%0A%0A%3Cp%3E%E5%B8%83%E5%B1%80%E7%9A%84%E4%BC%A0%E7%BB%9F%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%EF%BC%8C%E5%9F%BA%E4%BA%8E%3Ca%20href=%22https://developer.mozilla.org/en-US/docs/Web/CSS/box_model%22%20target=%22_blank%22%3E%E7%9B%92%E7%8A%B6%E6%A8%A1%E5%9E%8B%3C/a%3E%EF%BC%8C%E4%BE%9D%E8%B5%96&amp;nbsp;%3Ca%20href=%22https://developer.mozilla.org/en-US/docs/Web/CSS/display%22%20target=%22_blank%22%3Edisplay%3C/a%3E&amp;nbsp;%E5%B1%9E%E6%80%A7%20+&amp;nbsp;%3Ca%20href=%22https://developer.mozilla.org/en-US/docs/Web/CSS/position%22%20target=%22_blank%22%3Eposition%3C/a%3E%E5%B1%9E%E6%80%A7%20+&amp;nbsp;%3Ca%20href=%22https://developer.mozilla.org/en-US/docs/Web/CSS/float%22%20target=%22_blank%22%3Efloat%3C/a%3E%E5%B1%9E%E6%80%A7%E3%80%82%E5%AE%83%E5%AF%B9%E4%BA%8E%E9%82%A3%E4%BA%9B%E7%89%B9%E6%AE%8A%E5%B8%83%E5%B1%80%E9%9D%9E%E5%B8%B8%E4%B8%8D%E6%96%B9%E4%BE%BF%EF%BC%8C%E6%AF%94%E5%A6%82%EF%BC%8C%3Ca%20href=%22https://css-tricks.com/centering-css-complete-guide/%22%20target=%22_blank%22%3E%E5%9E%82%E7%9B%B4%E5%B1%85%E4%B8%AD%3C/a%3E%E5%B0%B1%E4%B8%8D%E5%AE%B9%E6%98%93%E5%AE%9E%E7%8E%B0%E3%80%82%3C/p%3E%0A%0A%3Cp%3E%3Cimg%20alt=%22%22%20src=%22https://www.ruanyifeng.com/blogimg/asset/2015/bg2015071002.png%22%20title=%22%22%20/%3E%3C/p%3E%0A%0A%3Cp%3E2009%E5%B9%B4%EF%BC%8CW3C%20%E6%8F%90%E5%87%BA%E4%BA%86%E4%B8%80%E7%A7%8D%E6%96%B0%E7%9A%84%E6%96%B9%E6%A1%88----Flex%20%E5%B8%83%E5%B1%80%EF%BC%8C%E5%8F%AF%E4%BB%A5%E7%AE%80%E4%BE%BF%E3%80%81%E5%AE%8C%E6%95%B4%E3%80%81%E5%93%8D%E5%BA%94%E5%BC%8F%E5%9C%B0%E5%AE%9E%E7%8E%B0%E5%90%84%E7%A7%8D%E9%A1%B5%E9%9D%A2%E5%B8%83%E5%B1%80%E3%80%82%E7%9B%AE%E5%89%8D%EF%BC%8C%E5%AE%83%E5%B7%B2%E7%BB%8F%E5%BE%97%E5%88%B0%E4%BA%86%E6%89%80%E6%9C%89%E6%B5%8F%E8%A7%88%E5%99%A8%E7%9A%84%E6%94%AF%E6%8C%81%EF%BC%8C%E8%BF%99%E6%84%8F%E5%91%B3%E7%9D%80%EF%BC%8C%E7%8E%B0%E5%9C%A8%E5%B0%B1%E8%83%BD%E5%BE%88%E5%AE%89%E5%85%A8%E5%9C%B0%E4%BD%BF%E7%94%A8%E8%BF%99%E9%A1%B9%E5%8A%9F%E8%83%BD%E3%80%82%3C/p%3E%0A%0A%3Cp%3E%3Cimg%20alt=%22%22%20src=%22https://www.ruanyifeng.com/blogimg/asset/2015/bg2015071003.jpg%22%20title=%22%22%20/%3E%3C/p%3E%0A%0A%3Cp%3EFlex%20%E5%B8%83%E5%B1%80%E5%B0%86%E6%88%90%E4%B8%BA%E6%9C%AA%E6%9D%A5%E5%B8%83%E5%B1%80%E7%9A%84%E9%A6%96%E9%80%89%E6%96%B9%E6%A1%88%E3%80%82%E6%9C%AC%E6%96%87%E4%BB%8B%E7%BB%8D%E5%AE%83%E7%9A%84%E8%AF%AD%E6%B3%95%EF%BC%8C%3Ca%20href=%22https://www.ruanyifeng.com/blog/2015/07/flex-examples.html%22%20target=%22_blank%22%3E%E4%B8%8B%E4%B8%80%E7%AF%87%E6%96%87%E7%AB%A0%3C/a%3E%E7%BB%99%E5%87%BA%E5%B8%B8%E8%A7%81%E5%B8%83%E5%B1%80%E7%9A%84%20Flex%20%E5%86%99%E6%B3%95%E3%80%82%E7%BD%91%E5%8F%8B&amp;nbsp;%3Ca%20href=%22http://vgee.cn/%22%20target=%22_blank%22%3EJailBreak%3C/a%3E&amp;nbsp;%E4%B8%BA%E6%9C%AC%E6%96%87%E7%9A%84%E6%89%80%E6%9C%89%E7%A4%BA%E4%BE%8B%E5%88%B6%E4%BD%9C%E4%BA%86&amp;nbsp;%3Ca%20href=%22http://static.vgee.cn/static/index.html%22%20target=%22_blank%22%3EDemo%3C/a%3E%EF%BC%8C%E4%B9%9F%E5%8F%AF%E4%BB%A5%E5%8F%82%E8%80%83%E3%80%82%3C/p%3E%0A%0A%3Cp%3E%E4%BB%A5%E4%B8%8B%E5%86%85%E5%AE%B9%E4%B8%BB%E8%A6%81%E5%8F%82%E8%80%83%E4%BA%86%E4%B8%8B%E9%9D%A2%E4%B8%A4%E7%AF%87%E6%96%87%E7%AB%A0%EF%BC%9A%3Ca%20href=%22https://css-tricks.com/snippets/css/a-guide-to-flexbox/%22%20target=%22_blank%22%3EA%20Complete%20Guide%20to%20Flexbox%3C/a%3E&amp;nbsp;%E5%92%8C&amp;nbsp;%3Ca%20href=%22https://scotch.io/tutorials/a-visual-guide-to-css3-flexbox-properties%22%20target=%22_blank%22%3EA%20Visual%20Guide%20to%20CSS3%20Flexbox%20Properties%3C/a%3E%E3%80%82%3C/p%3E%0A%0A%3Ch2%3E%E4%B8%80%E3%80%81Flex%20%E5%B8%83%E5%B1%80%E6%98%AF%E4%BB%80%E4%B9%88%EF%BC%9F%3C/h2%3E%0A%0A%3Cp%3EFlex%20%E6%98%AF%20Flexible%20Box%20%E7%9A%84%E7%BC%A9%E5%86%99%EF%BC%8C%E6%84%8F%E4%B8%BA&quot;%E5%BC%B9%E6%80%A7%E5%B8%83%E5%B1%80&quot;%EF%BC%8C%E7%94%A8%E6%9D%A5%E4%B8%BA%E7%9B%92%E7%8A%B6%E6%A8%A1%E5%9E%8B%E6%8F%90%E4%BE%9B%E6%9C%80%E5%A4%A7%E7%9A%84%E7%81%B5%E6%B4%BB%E6%80%A7%E3%80%82%3C/p%3E%0A%0A%3Cp%3E%E4%BB%BB%E4%BD%95%E4%B8%80%E4%B8%AA%E5%AE%B9%E5%99%A8%E9%83%BD%E5%8F%AF%E4%BB%A5%E6%8C%87%E5%AE%9A%E4%B8%BA%20Flex%20%E5%B8%83%E5%B1%80%E3%80%82%3C/p%3E%0A%0A%3Cblockquote%3E%0A%3Cpre%3E%0A.box%7B%0A%20%20display:%20flex;%0A%7D%0A%3C/pre%3E%0A%3C/blockquote%3E%0A%0A%3Cp%3E%E8%A1%8C%E5%86%85%E5%85%83%E7%B4%A0%E4%B9%9F%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8%20Flex%20%E5%B8%83%E5%B1%80%E3%80%82%3C/p%3E%0A%0A%3Cblockquote%3E%0A%3Cpre%3E%0A.box%7B%0A%20%20display:%20inline-flex;%0A%7D%0A%3C/pre%3E%0A%3C/blockquote%3E%0A%0A%3Cp%3EWebkit%20%E5%86%85%E6%A0%B8%E7%9A%84%E6%B5%8F%E8%A7%88%E5%99%A8%EF%BC%8C%E5%BF%85%E9%A1%BB%E5%8A%A0%E4%B8%8A-webkit%E5%89%8D%E7%BC%80%E3%80%82%3C/p%3E%0A%0A%3Cblockquote%3E%0A%3Cpre%3E%0A.box%7B%0A%20%20display:%20-webkit-flex;%20/*%20Safari%20*/%0A%20%20display:%20flex;%0A%7D%0A%3C/pre%3E%0A%3C/blockquote%3E%0A%0A%3Cp%3E%E6%B3%A8%E6%84%8F%EF%BC%8C%E8%AE%BE%E4%B8%BA%20Flex%20%E5%B8%83%E5%B1%80%E4%BB%A5%E5%90%8E%EF%BC%8C%E5%AD%90%E5%85%83%E7%B4%A0%E7%9A%84float%E3%80%81clear%E5%92%8Cvertical-align%E5%B1%9E%E6%80%A7%E5%B0%86%E5%A4%B1%E6%95%88%E3%80%82%3C/p%3E%0A%0A%3Ch2%3E%E4%BA%8C%E3%80%81%E5%9F%BA%E6%9C%AC%E6%A6%82%E5%BF%B5%3C/h2%3E%0A%0A%3Cp%3E%E9%87%87%E7%94%A8%20Flex%20%E5%B8%83%E5%B1%80%E7%9A%84%E5%85%83%E7%B4%A0%EF%BC%8C%E7%A7%B0%E4%B8%BA%20Flex%20%E5%AE%B9%E5%99%A8%EF%BC%88flex%20container%EF%BC%89%EF%BC%8C%E7%AE%80%E7%A7%B0&quot;%E5%AE%B9%E5%99%A8&quot;%E3%80%82%E5%AE%83%E7%9A%84%E6%89%80%E6%9C%89%E5%AD%90%E5%85%83%E7%B4%A0%E8%87%AA%E5%8A%A8%E6%88%90%E4%B8%BA%E5%AE%B9%E5%99%A8%E6%88%90%E5%91%98%EF%BC%8C%E7%A7%B0%E4%B8%BA%20Flex%20%E9%A1%B9%E7%9B%AE%EF%BC%88flex%20item%EF%BC%89%EF%BC%8C%E7%AE%80%E7%A7%B0&quot;%E9%A1%B9%E7%9B%AE&quot;%E3%80%82%3C/p%3E%0A";
        String html = URLDecoder.decode(s, String.valueOf(StandardCharsets.UTF_8));
        System.out.println(html);

        System.out.println();
        System.out.println("------------");
        System.out.println();

        System.out.println(delHTMLTag(html));
//        System.out.println(removeHtmlTag(html));

    }
}
